@echo off

SETLOCAL ENABLEDELAYEDEXPANSION

set MAVEN_OPTS=-XX:MaxPermSize=512M

rem set mvn_settings=e:\ws_support\maven\settings_tradoper.xml
rem set prj_dir_base=E:\workspaces\eclipse\bc_hscs20\Sources

set prj_name=%1
set prj_path=
if not x%prj_name% == x (
set prj_path=%prj_name%\
)

set mvn_cmdline=mvn clean install
if defined mvn_settings (
echo mvn_settings: %mvn_settings%
set mvn_cmdline=%mvn_cmdline% -s %mvn_settings%
)

set pom_file=%prj_path%pom.xml
if defined prj_dir_base (
set pom_file=%prj_dir_base%\!pom_file!
)

if exist !pom_file! (
call %mvn_cmdline% -f !pom_file!
if !errorlevel! neq 0 goto end
) else (
echo ===============================
echo %prj_name% not exists, will use the one in the repository
echo ===============================
)


:end

ENDLOCAL

pause
